package com.qxgltj.qxgl.dao;
import com.qxgltj.qxgl.model.Users;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
/**
 * IUsersDao
 */
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
public interface IUsersDao extends JpaRepository<Users,String>,JpaSpecificationExecutor<Users>{
	//重置密码
	@Modifying
	@Transactional
	@Query(value = "update users set password='123456' where id=?1 ",nativeQuery = true)
	int resetpass(String id);
		//解锁
	@Modifying
	@Transactional
	@Query(value = "update users set islockout=?1 where id=?2 ",nativeQuery = true)
	int  lock(String islockout,String id);
	//删除用户角色
	@Modifying
	@Transactional
	@Query(value = "DELETE from role_users where role_id=?1 ",nativeQuery = true)
       int  delRoles(String role_id);
}